import './assets/main.css'
import './assets/base.scss'
import '@renderer/assets/icon-font/iconfont.js'

import { createApp } from 'vue'
import App from './App.vue'
const app = createApp(App)

import router from './router'

/*路由*/
app.use(router)

/*使用持久化插件*/
import piniaPluginPersist from 'pinia-plugin-persist'
import {createPinia} from "pinia";
const store = createPinia()
store.use(piniaPluginPersist)
app.use(store)


/* ElementPlus*/
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
//引入element暗黑模式
import 'element-plus/theme-chalk/dark/css-vars.css'
app.use(ElementPlus)
/* ElementPlus icon*/
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}
/*markdown*/
//完整
import VueMarkdownEditor from '@kangc/v-md-editor';
import '@kangc/v-md-editor/lib/style/base-editor.css';
//vuepress样式组件
import vuepressTheme from '@kangc/v-md-editor/lib/theme/vuepress.js';
import '@kangc/v-md-editor/lib/theme/style/vuepress.css';
//vuepress代码高亮组件
import Prism from 'prismjs';
import 'prismjs/components/prism-json';
import 'prismjs/components/prism-java';
import 'prismjs/components/prism-sql';
import 'prismjs/components/prism-kotlin';
import 'prismjs/components/prism-properties';
import 'prismjs/components/prism-xml-doc';
//github样式组件
// import githubTheme from '@kangc/v-md-editor/lib/theme/github.js';
// import '@kangc/v-md-editor/lib/theme/style/github.css';
// githubhig代码高亮组件
// import hljs from 'highlight.js';
// 按需引入语言包
// import json from 'highlight.js/lib/languages/json';
// hljs.registerLanguage('json', json);
//todoList列表组件
import createTodoListPlugin from '@kangc/v-md-editor/lib/plugins/todo-list/index';
import '@kangc/v-md-editor/lib/plugins/todo-list/todo-list.css';
//复制代码组件
import createCopyCodePlugin from '@kangc/v-md-editor/lib/plugins/copy-code/index';
import '@kangc/v-md-editor/lib/plugins/copy-code/copy-code.css';

VueMarkdownEditor.use(vuepressTheme, {
  // Hljs: hljs,
  Prism,
});

VueMarkdownEditor.use(createTodoListPlugin());
VueMarkdownEditor.use(createCopyCodePlugin());

app.use(VueMarkdownEditor);
//预览组件
import VMdPreview from '@kangc/v-md-editor/lib/preview';
import '@kangc/v-md-editor/lib/style/preview.css';

VMdPreview.use(vuepressTheme, {
  // Hljs: hljs,
  Prism,
});
VMdPreview.use(createTodoListPlugin());
VMdPreview.use(createCopyCodePlugin());
app.use(VMdPreview);

app.mount('#app')
